test: make lease-expiry integration test deterministic#121
Conversation
The 50ms expiry window raced against submit-time validation on slow CI runners (lease already expired at submit -> INVALID_REQUEST instead of job.accepted). Widen the window to 1s and poll ValidateOpAsync until expiry instead of racing a fixed 150ms delay. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 10 minutes and 30 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
LeaseExpiryTests.ValidateOpAsync after expires_at raises LEASE_EXPIREDgave only a 50ms window between submit and lease expiry. On a loaded CI runner, submit-time validation saw the lease as already expired and rejected the submit withINVALID_REQUESTinstead ofjob.accepted(observed on PR #92's test run).expires_atto 1s so submit-time validation can't lose the race.ValidateOpAsyncpoll loop, so the first post-expiry call raisesLEASE_EXPIREDdeterministically.Verified locally: 5 consecutive runs of the lease-expiry tests plus the full 268 unit + 28 integration suite, all green.
🤖 Generated with Claude Code